<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

/**
 * Description of Usermemberlevel
 *
 * @author yonguo
 * @property int $level_id 等级ID
 * @property int $shop_id 店铺ID
 * @property string $level_name 等级名称
 * @property int $min_integral 累计积分
 * @property int $quota 消费额度
 * @property int $goods_discount 折扣率
 * @property string $desc 等级描述
 * @property int $is_default 是否是默认
 * @property int $upgrade 升级条件  1.累计积分 2.消费额度 3.同时满足
 * @property int $relation 1.或 2. 且
 * @property-read \Illuminate\Database\Eloquent\Collection|\App\Models\User[] $users
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Usermemberlevel whereDesc($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Usermemberlevel whereGoodsDiscount($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Usermemberlevel whereIsDefault($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Usermemberlevel whereLevelId($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Usermemberlevel whereLevelName($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Usermemberlevel whereMinIntegral($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Usermemberlevel whereQuota($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Usermemberlevel whereRelation($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Usermemberlevel whereShopId($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Usermemberlevel whereUpgrade($value)
 * @mixin \Eloquent
 */
class Usermemberlevel extends Model{
   protected $table = 'member_level';
    protected $primaryKey = 'level_id';
    protected $guarded = ['level_id'];

    public $timestamps = false;
    
    public function users()
    {
        return $this->hasMany(User::class, 'uid', 'uid');
    }
}
